package farmacia.gui.frenteLoja;

import java.awt.BorderLayout;
import java.awt.Desktop;
import java.awt.EventQueue;
import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.ImageIcon;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;

import org.jdesktop.swingx.JXTaskPane;

import farmacia.gui.cadastro.JfCliente;
import farmacia.gui.cadastro.JfFornecedor;
import farmacia.gui.cadastro.estoque.JfProduto;
import farmacia.gui.cadastro.estoque.JfSubstancia;

import javax.swing.JDesktopPane;
import java.awt.SystemColor;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.UIManager;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.ParseException;

public class MenuPrincipal extends JFrame {

	private JPanel contentPane;
	private org.jdesktop.swingx.JXTaskPane jXTaskPane1;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			//UIManager.setLookAndFeel("org.jvnet.substance.SubstanceLegacyDefaultLookAndFeel");
		} catch (Throwable e) {
			e.printStackTrace();
		}
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MenuPrincipal frame = new MenuPrincipal();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MenuPrincipal() {
		setTitle("NEW FARMÁCIA");
		setBounds(100, 100, 1280, 800);
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu mnCadastro = new JMenu("Cadastro");
		menuBar.add(mnCadastro);
		
		JMenu mnNewMenu_5 = new JMenu("Pessoas");
		mnCadastro.add(mnNewMenu_5);
		
		JMenuItem mntmCliente_1 = new JMenuItem("Cliente");
		mntmCliente_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				JfCliente cliente = null;
				try {
					cliente = new JfCliente();
				} catch (ParseException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				cliente.setVisible(true);
			}
		});
		mnNewMenu_5.add(mntmCliente_1);
		
		JMenuItem mntmFuncionario = new JMenuItem("Funcionario");
		mnNewMenu_5.add(mntmFuncionario);
		
		JMenu mnEstoque_1 = new JMenu("Estoque");
		mnCadastro.add(mnEstoque_1);
		
		JMenuItem mntmProduto_1 = new JMenuItem("Produto");
		mntmProduto_1.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				JfProduto produto = null;
				produto = new JfProduto();
				
				produto.setVisible(true);
			}
		});
		mnEstoque_1.add(mntmProduto_1);
		
		JMenuItem mntmSubstancia = new JMenuItem("Substancia");
		mntmSubstancia.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
			JfSubstancia substancia = new JfSubstancia();
			substancia.setVisible(true);
			}
		});
		mnEstoque_1.add(mntmSubstancia);
		
		JMenuItem mntmFornecedor = new JMenuItem("Fornecedor");
		mntmFornecedor.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				JfFornecedor fornecedor = null;
				try {
					fornecedor = new JfFornecedor();
				} catch (ParseException e1) {
					// TODO Auto-generated catch block
					e1.printStackTrace();
				}
				fornecedor.setVisible(true);
			}
		});
		mnCadastro.add(mntmFornecedor);
		
		JMenu mnEstoque = new JMenu("Estoque");
		menuBar.add(mnEstoque);
		
		JMenu mnNewMenu = new JMenu("Caixa");
		menuBar.add(mnNewMenu);
		
		JMenu mnNewMenu_1 = new JMenu("Relatorios");
		menuBar.add(mnNewMenu_1);
		
		JMenu mnNewMenu_2 = new JMenu("Vendas");
		mnNewMenu_2.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				JfAtendimento atendimento = new JfAtendimento();
				atendimento.setVisible(true);
			}
		});
		menuBar.add(mnNewMenu_2);
		
		JMenu mnNewMenu_3 = new JMenu("Opção");
		menuBar.add(mnNewMenu_3);
		
		JMenu mnManuteno = new JMenu("Manutenção");
		menuBar.add(mnManuteno);
		
		JMenuItem mntmUsuarios = new JMenuItem("Usuarios");
		mnManuteno.add(mntmUsuarios);
		
		JMenu mnNewMenu_4 = new JMenu("Sobre");
		menuBar.add(mnNewMenu_4);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBackground(Color.WHITE);
		panel.setBounds(0, 0, 1272, 726);
		contentPane.add(panel);
		panel.setLayout(null);
		
		JLabel lblNewLabel = new JLabel("");
		lblNewLabel.setIcon(new ImageIcon("/home/jorge/workspace/New Farmacia/imagens/logotipo.jpg"));
		lblNewLabel.setBounds(360, 71, 543, 568);
		panel.add(lblNewLabel);
		}
}
